<h5>资产领用</h5>
<div class="content">
  <form #assetoutForm="ngForm">
    <div class="assetusemsg">
      <div class="form-group  w-50">
        <label class="mr-2"><span class="red">*</span>领用后使用部门</label>
        <select required class="form-control mr-2" type="text" (ngModelChange)="changeDepartment($event)" [(ngModel)]="deliver.new_departmentid" name="new_departmentid" >
          <option *ngFor="let department of departments" [value]="department.id" >
            {{department.departName}}
          </option>
        </select>
        <span class="cursor" (click)="addDepartment()">新增</span>
        <div class="red" *ngIf="messages.new_departmentid">{{ messages.new_departmentid }}</div>
      </div>
      <div class="form-group  w-50">
        <label class="mr-2"><span class="red">*</span>领用后使用人</label>
        <select required class="form-control mr-2" type="text" (ngModelChange)="changeUser($event)"  [(ngModel)]="deliver.new_userid" name="new_userid">
          <option>请选择</option>
          <option *ngFor="let user of users" [value]="user.id">
            {{user.realName}}
          </option>
        </select>
        <span class="cursor" (click)="addPerson()">新增</span>
        <div class="red" *ngIf="messages.new_userid">{{ messages.new_userid }}</div>
      </div>
      <div class="form-group  w-50">
        <label class="mr-2"><span class="red">*</span>领用后座位号</label>
        <input required class="form-control mr-2" type="text"  placeholder="请输入领用后座位号" [(ngModel)]="deliver.address" name="address" readonly>
      </div>

      <!--新增字段-->
      <div class="form-group  w-50">
        <label class="mr-2"><span class="red">*</span>领用后存放地</label>
        <input required class="form-control mr-2" type="text"  placeholder="请输入领用后存放位置">
      </div>

      <div class="form-group  w-50">
        <label class="mr-2">领用时间</label>
        <input class="form-control mr-2" matInput [matDatepicker]="deliverpicker" placeholder="选择日期" [value]="deliver.deliverDateShow?.value"
               (dateChange)="onSelectdeliverDate($event)">
        <mat-datepicker-toggle matSuffix [for]="deliverpicker"></mat-datepicker-toggle>
        <mat-datepicker  #deliverpicker></mat-datepicker>
      </div>
      <div class="form-group  w-50">
        <label class="mr-2">处理人</label>
        <input class="form-control mr-2" type="text"  [(ngModel)]="dealname" name="dealname" readonly>
      </div>
    </div>
    <div class="w-100">
      <label>资产备注</label>
      <div class="form-group">
        <textarea class="form-control" style="width: 93%;resize: none" [(ngModel)]="deliver.remark" name="remark"></textarea>
      </div>
    </div>
    <label>查看领用的资产</label>
    <div class="grid">
      <table mat-table [dataSource]="Assets | paginate: {itemsPerPage: PageSize, currentPage: Page, totalItems: Total}"  [trackBy]="trackBynewId" class="table-hover table-bordered w-100">

        <ng-container matColumnDef="assetCode">
          <th mat-header-cell *matHeaderCellDef>资产编码</th>
          <td mat-cell *matCellDef="let row">{{ row.assetCode}}</td>
        </ng-container>

        <ng-container matColumnDef="assetName">
          <th mat-header-cell *matHeaderCellDef>资产名称</th>
          <td class="overWords" mat-cell *matCellDef="let row ">{{ row.assetName }}</td>
        </ng-container>

        <ng-container matColumnDef="assetType">
          <th mat-header-cell *matHeaderCellDef>资产类别</th>
          <td mat-cell *matCellDef="let row">{{ row.oaAssetType?.GDZCLBMC }}</td>
        </ng-container>

        <ng-container matColumnDef="assetDate">
          <th mat-header-cell *matHeaderCellDef>入库时间</th>
          <td mat-cell *matCellDef="let row">{{ row.buyDate | date: 'yyyy-MM-dd' }}</td>
        </ng-container>


        <!--对应列名List.ts中定义-->
        <tr mat-header-row *matHeaderRowDef="cols"></tr>
        <tr mat-row *matRowDef="let data; columns: cols"></tr>
      </table>
    </div>
  </form>
  <app-pagination id="page2323"
                  (pageChange)="onPageChange($event)"
                  [maxSize]="9"
                  [isShowInput]="true"
                  [isMiniMode]="false"
                  [isShowPage]="false"
                  [total]="Total"
  >
  </app-pagination>
</div>
<div class="buttons text-center">
  <button class="btn btn-outline-primary mr-2" type="button" (click)="onSubmit()">保存</button>
  <button class="btn btn-outline-secondary" type="button" [mat-dialog-close] cdkFocusInitial>取消</button>
</div>
<div *ngIf="appearSearch" class="superBox" style="top: 21% !important;">
  <div class="modalContent">
    <label>退库原因</label>
    <div class="assetusemsg">
      <textarea  id="" cols="30" rows="10" style="width: 100%;height: 100px" [(ngModel)]="outasset.remark" name="realName"></textarea>
    </div>
    <div class="modal-footer">
      <button type="button" class="btn btn-primary" (click)="sureout()">确认</button>
      <button type="button" class="btn btn-danger"  (click)="closesearch()">关闭</button>
    </div>
  </div>
</div>
